package com.kate.mall.order.price;



import com.kate.mall.order.dto.GoodsSkuDTO;
import com.kate.mall.order.dto.OrderItemDTO;

import java.math.BigDecimal;

/**
 * 赠品类型的促销活动计算组件的基类
 * @author kate2chan
 *
 */
public class AbstractGiftPromotionActivityCalculator {

	/**
	 * 创建订单条目
	 * @param goodsSku 商品sku
	 * @return
	 */
	protected OrderItemDTO createOrderItem(GoodsSkuDTO goodsSku) {
		OrderItemDTO orderItem = new OrderItemDTO();
		orderItem.setGoodsId(goodsSku.getGoodsId()); 
		orderItem.setProductId(goodsSku.getId());
		orderItem.setGoodsName(goodsSku.getGoodsName());
		orderItem.setSpecifications(goodsSku.getSpecifications());
		orderItem.setNumber(1);
		orderItem.setPrice(new BigDecimal(0.0));
		orderItem.setPromotionActivityId(null); 
		return orderItem;
	}
	
}